package xin.lms.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import xin.core.jpa.JpaConstant;
import xin.core.jpa.model.UUIDEntity;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * <pre>
 * System important operate event
 * </pre>
 *
 * @author lixin@outlook.com
 * @version 1.0
 * @since 2017/11/22 18:25
 */
@Table(name = "sys_event_log")
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@EqualsAndHashCode(callSuper = true)
public class Event extends UUIDEntity {

    @Column(length = JpaConstant.UidColumnLength)
    protected String operatorId;

    @Column(length = JpaConstant.UidColumnLength)
    protected String operatorName;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Column()
    protected Date operateDate;


    @Column(columnDefinition = "text")
    protected String detail;

    @Column(length = JpaConstant.UidColumnLength)
    private String name;

    @Column()
    private Boolean success;
}